package main

import (
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"
	"github.com/micro/go-micro/v2/web"
	"github.com/micro/go-plugins/registry/consul/v2"

	"gomicro/httpJsonMicro/hjmClient/controller"
	"gomicro/httpJsonMicro/hjmClient/util"
	"log"
)

func main() {

	util.EtcdRegistry = consul.NewRegistry()

	service := web.NewService(
		web.Name("go.micro.api.member.client"),
		web.Registry(util.EtcdRegistry),
	)

	service.Init()

	app := iris.New()
	mvc.New(app).Handle(new(controller.MemberMicroController))
	app.Run(iris.Addr(":7911"))

	service.Handle("/", app)

	if err := service.Run(); err != nil {
		log.Fatal(err)
	}

}

/*
自定义负载均衡：创建结构体，实现方法，初始化 //micro.Selector(&结构体实例),
*/